const { defineConfig } = require("@vue/cli-service");

const path = require("path");

function resolve(dir) {
  return path.join(__dirname, dir);
}

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    proxy: {
      '/geoApi': {
        target: "https://geo.datav.aliyun.com/areas_v3",
        changeOrigin: true,
        pathRewrite: {
          "^/geoApi": "/",
        },
      },
      "/mapApi": {
        target: "https://apis.map.qq.com",
        changeOrigin: true,
        pathRewrite: {
          "^/mapApi": "/",
        },
      },
    },
  },
  configureWebpack: {
    // name: name,
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },
  },
});
